<template>
<view class="page">
	<template v-if="loadingState.default">
		<loading :loadingState="loadingState"></loading>
	</template>
	<template v-else>
		<view class="body"> 		
			<view class="content-area">
				<!-- <view class="title">{{detail.title}}</view> -->
				<view class="content">
					<rich-text :nodes="htmlContent"></rich-text>
				</view>  
				
				<view class="tips">
					<view class="m-b2">系统通知</view>
					<view>{{detail.pubdate}}</view>
				</view>
			</view>			
			  
		</view> 
	</template>
</view>
</template>

<script>
import { htmlParse } from '@/common/util.js'
import loading from '@/components/loading-more.vue'
import empty from '@/components/empty.vue' 

export default{
	name:'list',
	data(){
		return {
			isIphoneX:false,
			id:'', 
			type:'',
			detail:{}, 
			htmlContent:[], 
			loadingState:{
				default:true
			}, 
			userInfo:uni.getStorageSync('userInfo'),
			isLogin:false,    
			web_host:getApp().globalData.web_host_2
		}
	},
	async onLoad(params) { 
		console.log(params)
		this.id=params.id; 
		this.isLogin = await this.$loginState(); 
		this.detail=await this.getDetail();  
	},
	mounted() {
		 
	},
	onReachBottom(){
		 
	},
	methods:{
		getDetail:async function(){
			let res=await this.$api.news_api.news({
				act:'artinfo',
				id:this.id
			})   
			if(res.data.rcode==1){				
				this.loadingState.default=false;	
				this.htmlContent=htmlParse(res.data.data.info.body);				 
				return res.data.data.info;				 
			}else{
				this.loadingState.default=false;
			}
		}, 
		 
		 
	},
	components:{  
		loading,
		empty 
	},
	computed:{
		 
	},
	watch:{
		 
	}
}
</script>

<style lang="less" scoped> 
.page{
	background: #fff;
}
.content-area{
	background: #fff;
	padding:20rpx;
	margin-bottom: 20rpx;
	.title{
		margin-bottom:30rpx;
		font-size:30rpx;
		font-weight: bold;
		text-align: center;
	}
	.label-bar{
		margin-bottom: 40rpx;;
		font-size:26rpx;
		color:#999;
		text{
			margin-right: 20rpx;
		}
	} 
	.content{
		margin-bottom:40rpx;
		overflow: hidden;
		font-size: 28rpx;
	}
	 
}
.content { 
	::v-deep .html_p{
		line-height: 54rpx;
		text-align: left!important;
		margin-bottom: 20rpx;
		text-indent: 2em;
		font-size: 32rpx; 
	}
	::v-deep .html_img{
		width: 100%!important;
		height: auto!important;
		margin:20rpx 0 20rpx -2em;
		
	}
	
}
.tips{
	text-align: right;
	font-size: 30rpx;
	color: #666;
	
}
 
</style>
